<div id="page-heading"><h1><?php echo lang('tags.manage_title'); ?></h1></div>
<?php $this->load->view('partials/notices'); ?>
<?php if ($tags): ?>
<?php echo form_open('admin/catalog/action_tag', 'id="mainform"');?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" id="product-table">
				<tbody>
				<tr>
				<?php if (group_has_role('catalog', 'delete_tag')): ?>
					<th class="table-header-check"><a id="toggle-all" ></a> </th>
				<?php endif;?>
					<th class="table-header-repeat line-left"><a href="javascript:void(0);"><?php echo lang('tags.name_label'); ?></a></th>
					<th class="table-header-repeat line-left"><a href="javascript:void(0);"><?php echo lang('global:created'); ?></a></th>
					<th class="table-header-repeat line-left"><a href="javascript:void(0);"><?php echo lang('global:actions')?></a></th>
				</tr>
				<?php foreach ($tags as $key => $tag): ?>
				<tr <?php if($key%2 == 0):?>class="alternate-row"<?php endif;?>>
					<?php if (group_has_role('catalog', 'delete_tag')): ?>
						<td><?php echo form_checkbox('action_to[]', $tag->id); ?></td>
					<?php endif; ?>
					<td><?php echo anchor('admin/catalog/edit_tag/' . $tag->id, $tag->name, 'title="' . $tag->name .'" class="folder-hash"'); ?></td>
					<td><?php echo date('Y-m-d', $tag->created)?></td>
					<td class="options-width">
					<?php if (group_has_role('catalog', 'edit_tag')): ?>
						<?php echo anchor('admin/catalog/edit_tag/' . $tag->id, ' ', 'title="'. lang('buttons.edit').'" class="icon-1 info-tooltip"'); ?>
						<?php endif; ?>
						<?php if (group_has_role('catalog', 'delete_tag')): ?>
						<a class="icon-2 info-tooltip" title="<?php echo lang('buttons.delete');?>" href="javascript:void(0);" onclick="if(confirm('<?php echo lang('global:delete')?>')){window.location.href='<?php echo site_url('admin/catalog/delete_tag/' . $tag->id);?>'}"></a>
						<?php endif; ?>
					</td>
				</tr>
				<?php endforeach;?>
				</tbody>
</table>
<input type="hidden" name="btnAction"  id="btnAction" value=""/>
<?php if (group_has_role('catalog', 'delete_tag')): ?>
<script type="text/javascript">
	function submit_form(type)
	{
		if('delete' == type){
			$('#btnAction').val('delete');
			$('#mainform').submit();
		}
	}
</script>
<div id="actions-box">
	<a href="" class="action-slider"></a>
	<div id="actions-box-slider">
		<a href="javascript:void(0);" onclick="submit_form('delete');" class="action-delete">Delete</a>
	</div>
	<div class="clear"></div>
</div>
<div align=center><div class="inner"><?php $this->load->view('partials/pagination'); ?></div></div>
<?php endif; ?>
<?php echo form_close();?>

<?php else: ?>
	<div class="no_data file-tags">
		<p><?php echo lang('tags.no_tag');?></p>
		<br />
		<p>[<a href="<?php echo site_url('admin/catalog/create_tag')?>"><?php echo lang('menu_2_catalog_create_tag')?></a>]</p>
	</div>
<?php endif; ?>